#include <iostream>
using std::cout;
using std::endl;

int gNum = 1;

const int gcNum = 20;

void test0(){
    const int cNum = 108;
    static int sNum = 18;
    int num = 100;
    int num2 = 200;
    cout << "&num2:" << &num2 << endl;
    cout << "&num:" << &num << endl;
    cout << "&cNum:" << &cNum << endl;

    int * p = new int(20);
    int * p2 = new int(30);
    cout << "p2:" << p2 << endl;
    cout << "p:" << p << endl;

    cout << "&sNum:" << &sNum << endl;
    cout << "&gNum:" << &gNum << endl;

    const char * pstr = "hello";
    /* char * pstr = "hello"; */
    /* pstr[0] = 'H'; */


    //输出流运算符对char*的默认重载效果
    //会对指针所指向的内容进行自动的访问
    cout << pstr << endl;
    printf("%p\n",pstr);
    cout << static_cast<void*>(const_cast<char*>(pstr)) << endl;
    cout << "&gcNum:" << &gcNum << endl;

    printf("%p\n",&test0);
}

int main(void){
    test0();
    printf("%p\n",&main);
    return 0;
}
